from flask import Flask
try:
    from .decorators import *
    from .workflow import Workflow
    from .data import Data
except:
    from decorators import *
    from workflow import Workflow
    from data import Data
app = Flask(__name__)

desc(app)(lambda: "刺激信息提取工具，为基于电刺激的昆虫机器人运动数据处理系统编写")

meta(app)(lambda: ("stimulus-extract", "刺激信息提取工具", "stimulus"))

@tasks(app)
def tasks():
    return [
        "task1: Void -> Void",
        "task2: Str -> Json",
        "task3: Int -> FilePath"
    ]

@workflows(app)
def workflows():
    return [
        Workflow("workflow1", "workflow1", ["this.task1", "this.task2", "this.task3"], [True, False, True])
    ]

@qinstantq_task(app, TypeSchema.Void(), TypeSchema.Void())
def task1(input: 'Data'):
    return None

if __name__ == "__main__":
    app.run(port=5000, debug=True)
